package com.briup.day21;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;

public class Test05_Exception {
    public static void main(String[] args) {
        //Unhandled exception: java.io.FileNotFoundException
        // FileNotFoundException 编译时异常: 如果不主动处理，编译无法通过
        //FileInputStream fis =
        //        new FileInputStream("E:/briup/code/a.txt");


    }

    //异常的传播行为
    public static void main01(String[] args) {
        int[] arr = {1,2,3};
        System.out.println(arr[4]);

        test01();

        System.out.println("main end ...");
    }

    public static void test01() {
        System.out.println("in test01 ...");
        test02();
        System.out.println("in test01, after test02 ...");
    }

    public static void test02() {
        System.out.println("in test02 ...");
        test03();
        System.out.println("in test02, after test03 ...");
    }

    public static void test03() {
        System.out.println("in test03 ...");
        int a = 10 / 0;
        System.out.println("in test03, after 10/0 ...");
    }
}
